﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BlogsAPI.Sites
{
    /// <summary>
    /// Объект получаемый при разботе публикации перископа
    /// </summary>
    public class PeriscopeUser
    {
        /// <summary>
        /// идентификатор 
        /// </summary>
        [JsonMapping("id", JsonMapping.MappingType.Primitive)]
        public string Id { get; set; }

        /// <summary>
        /// ник 
        /// </summary>
        [JsonMapping("username", JsonMapping.MappingType.Primitive)]
        public string Username { get; set; }

        /// <summary>
        /// ник в твиттере, если нет, то пусто
        /// </summary>
        [JsonMapping("twitter_screen_name", JsonMapping.MappingType.Primitive)]
        public string TwitterScreenName { get; set; }

        /// <summary>
        /// описание
        /// </summary>
        [JsonMapping("description", JsonMapping.MappingType.Primitive)]
        public string Description { get; set; }

        /// <summary>
        /// ник 
        /// </summary>
        [JsonMapping("display_name", JsonMapping.MappingType.Primitive)]
        public string DisplayName { get; set; }

        /// <summary>
        /// время создания 
        /// </summary>
        [JsonMapping("created_at", JsonMapping.MappingType.Primitive)]
        public DateTimeOffset Created { get; set; }

        /// <summary>
        /// время обновления 
        /// </summary>
        [JsonMapping("updated_at", JsonMapping.MappingType.Primitive)]
        public DateTimeOffset Updated { get; set; }

        /// <summary>
        /// подписчиков
        /// </summary>
        [JsonMapping("n_followers", JsonMapping.MappingType.Primitive)]
        public int Followers { get; set; }

        /// <summary>
        /// подписан на
        /// </summary>
        [JsonMapping("n_following", JsonMapping.MappingType.Primitive)]
        public int Friends { get; set; }

        /// <summary>
        /// Число сердечек
        /// </summary>
        [JsonMapping("n_hearts", JsonMapping.MappingType.Primitive)]
        public long Hearts { get; set; }

        /// <summary>
        /// Массив аватарок
        /// </summary>
        [JsonMapping("profile_image_urls", JsonMapping.MappingType.Collection)]
        public List<Image> ProfileImages { get; set; }

        /// <summary>
        /// Статус программы
        /// https://www.periscope.tv/vipprogram
        /// </summary>
        [JsonMapping("vip", JsonMapping.MappingType.Primitive)]
        public string Vip { get; set; }

        /// <summary>
        /// Твиттер верифицирован ли?
        /// </summary>
        [JsonMapping("is_twitter_verified", JsonMapping.MappingType.Primitive)]
        public bool IsVerified { get; set; }

        /// <summary>
        /// У кого нет профиля в перископе, а только ссылка на твиттер
        /// </summary>
        [JsonMapping("is_bluebird_user", JsonMapping.MappingType.Primitive)]
        public bool IsBlueBird { get; set; }
    }

    /// <summary>
    /// Аватарки пользователя
    /// </summary>
    public class Image
    {
        /// <summary>
        /// Link
        /// </summary>
        [JsonMapping("url", JsonMapping.MappingType.Primitive)]
        public string url { get; set; }

        /// <summary>
        /// width
        /// </summary>
        [JsonMapping("width", JsonMapping.MappingType.Primitive)]
        public int Width { get; set; }

        /// <summary>
        /// height
        /// </summary>
        [JsonMapping("height", JsonMapping.MappingType.Primitive)]
        public int Height { get; set; }
    }
}